package com.imelite.qyh.action;

import com.imelite.qyh.model.EliteCRMView_OrgUser;
import com.imelite.qyh.model.EliteCRMView_js;
import com.imelite.qyh.service.EliteCRMView_jsService;
import com.imelite.qyh.util.BaseUserUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Controller
public class JsAction {

    @Autowired
    private EliteCRMView_jsService eliteCRMView_jsService;

    /**
     * 获得当前登陆者的教师考勤
     * @param request
     * @param response
     * @param queryDay
     * @return
     */
    @RequestMapping("/com/imelite/qyh/JsAction/getMyCourse")
    public String getMyCourse(HttpServletRequest request, HttpServletResponse response,String queryDay){
        EliteCRMView_OrgUser user= BaseUserUtil.getUser(request);
        EliteCRMView_js js=new EliteCRMView_js();
        js.setIddep(user.getIddep());
        js.setJs(user.getId());
        js.setQueryDay(queryDay);
        List<EliteCRMView_js> jsList=eliteCRMView_jsService.selectByJsAndTimes(js);
        request.setAttribute("jsList",jsList);
        request.setAttribute("user",user);
        return "/Elite/Elite_MyCoursePage";
    }
}
